package com.ddn.service.hall.impl;

import com.ddn.mapper.hall.UserMapper;

import com.ddn.model.hall.User;
import com.ddn.service.hall.UserService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/*
  ❀❀❀---扎根---❀❀❀
    ❤ @libing ❤
  
*/
@Service
public class UserSercviceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User userLogin(HashMap<String, Object> map) {
        User user = userMapper.userLogin(map);
       return user;
    }

    @Override
    public ResultData userInfo(HashMap<String, Object> map) {
        User user = userMapper.userLogin(map);

        if (user != null) {
            return ResultData.ok(user);
        }
        return ResultData.fail();
    }

    @Override
    public ResultData userPassword(HashMap<String, Object> map) {
        int i =userMapper.userPassword(map);
        if (i >0) {
            return ResultData.ok();
        }
        return ResultData.fail();
    }
}
